\(\int \tan ^3(c+d x) \, dx\) [3]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [A] (verification not implemented)
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 8, antiderivative size = 27 \[ \int \tan ^3(c+d x) \, dx=\frac {\log (\cos (c+d x))}{d}+\frac {\tan ^2(c+d x)}{2 d} \]

[Out]

ln(cos(d*x+c))/d+1/2*tan(d*x+c)^2/d

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {3554, 3556} \[ \int \tan ^3(c+d x) \, dx=\frac {\tan ^2(c+d x)}{2 d}+\frac {\log (\cos (c+d x))}{d} \]

[In]

Int[Tan[c + d*x]^3,x]

[Out]

Log[Cos[c + d*x]]/d + Tan[c + d*x]^2/(2*d)

Rule 3554

Int[((b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b*((b*Tan[c + d*x])^(n - 1)/(d*(n - 1))), x] - Dis
t[b^2, Int[(b*Tan[c + d*x])^(n - 2), x], x] /; FreeQ[{b, c, d}, x] && GtQ[n, 1]

Rule 3556

Int[tan[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-Log[RemoveContent[Cos[c + d*x], x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps \begin{align*} \text {integral}& = \frac {\tan ^2(c+d x)}{2 d}-\int \tan (c+d x) \, dx \\ & = \frac {\log (\cos (c+d x))}{d}+\frac {\tan ^2(c+d x)}{2 d} \\ \end{align*}

Mathematica [A] (verified)

Time = 0.04 (sec) , antiderivative size = 25, normalized size of antiderivative = 0.93 \[ \int \tan ^3(c+d x) \, dx=\frac {2 \log (\cos (c+d x))+\tan ^2(c+d x)}{2 d} \]

[In]

Integrate[Tan[c + d*x]^3,x]

[Out]

(2*Log[Cos[c + d*x]] + Tan[c + d*x]^2)/(2*d)

Maple [A] (verified)

Time = 0.05 (sec) , antiderivative size = 28, normalized size of antiderivative = 1.04

method result size
parallelrisch \(-\frac {-\left (\tan ^{2}\left (d x +c \right )\right )+\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(28\)
derivativedivides \(\frac {\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}}{d}\) \(29\)
default \(\frac {\frac {\left (\tan ^{2}\left (d x +c \right )\right )}{2}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2}}{d}\) \(29\)
norman \(\frac {\tan ^{2}\left (d x +c \right )}{2 d}-\frac {\ln \left (1+\tan ^{2}\left (d x +c \right )\right )}{2 d}\) \(31\)
risch \(-i x -\frac {2 i c}{d}+\frac {2 \,{\mathrm e}^{2 i \left (d x +c \right )}}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{d}\) \(56\)

[In]

int(tan(d*x+c)^3,x,method=_RETURNVERBOSE)

[Out]

-1/2*(-tan(d*x+c)^2+ln(1+tan(d*x+c)^2))/d

Fricas [A] (verification not implemented)

none

Time = 0.25 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.00 \[ \int \tan ^3(c+d x) \, dx=\frac {\tan \left (d x + c\right )^{2} + \log \left (\frac {1}{\tan \left (d x + c\right )^{2} + 1}\right )}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3,x, algorithm="fricas")

[Out]

1/2*(tan(d*x + c)^2 + log(1/(tan(d*x + c)^2 + 1)))/d

Sympy [A] (verification not implemented)

Time = 0.08 (sec) , antiderivative size = 32, normalized size of antiderivative = 1.19 \[ \int \tan ^3(c+d x) \, dx=\begin {cases} - \frac {\log {\left (\tan ^{2}{\left (c + d x \right )} + 1 \right )}}{2 d} + \frac {\tan ^{2}{\left (c + d x \right )}}{2 d} & \text {for}\: d \neq 0 \\x \tan ^{3}{\left (c \right )} & \text {otherwise} \end {cases} \]

[In]

integrate(tan(d*x+c)**3,x)

[Out]

Piecewise((-log(tan(c + d*x)**2 + 1)/(2*d) + tan(c + d*x)**2/(2*d), Ne(d, 0)), (x*tan(c)**3, True))

Maxima [A] (verification not implemented)

none

Time = 0.19 (sec) , antiderivative size = 31, normalized size of antiderivative = 1.15 \[ \int \tan ^3(c+d x) \, dx=-\frac {\frac {1}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right )^{2} - 1\right )}{2 \, d} \]

[In]

integrate(tan(d*x+c)^3,x, algorithm="maxima")

[Out]

-1/2*(1/(sin(d*x + c)^2 - 1) - log(sin(d*x + c)^2 - 1))/d

Giac [B] (verification not implemented)

Leaf count of result is larger than twice the leaf count of optimal. 216 vs. \(2 (25) = 50\).

Time = 0.59 (sec) , antiderivative size = 216, normalized size of antiderivative = 8.00 \[ \int \tan ^3(c+d x) \, dx=\frac {\log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) \tan \left (d x\right ) \tan \left (c\right ) + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + \log \left (\frac {4 \, {\left (\tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, \tan \left (d x\right ) \tan \left (c\right ) + 1\right )}}{\tan \left (d x\right )^{2} \tan \left (c\right )^{2} + \tan \left (d x\right )^{2} + \tan \left (c\right )^{2} + 1}\right ) + 1}{2 \, {\left (d \tan \left (d x\right )^{2} \tan \left (c\right )^{2} - 2 \, d \tan \left (d x\right ) \tan \left (c\right ) + d\right )}} \]

[In]

integrate(tan(d*x+c)^3,x, algorithm="giac")

[Out]

1/2*(log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*ta
n(d*x)^2*tan(c)^2 + tan(d*x)^2*tan(c)^2 - 2*log(4*(tan(d*x)^2*tan(c)^2 - 2*tan(d*x)*tan(c) + 1)/(tan(d*x)^2*ta
n(c)^2 + tan(d*x)^2 + tan(c)^2 + 1))*tan(d*x)*tan(c) + tan(d*x)^2 + tan(c)^2 + log(4*(tan(d*x)^2*tan(c)^2 - 2*
tan(d*x)*tan(c) + 1)/(tan(d*x)^2*tan(c)^2 + tan(d*x)^2 + tan(c)^2 + 1)) + 1)/(d*tan(d*x)^2*tan(c)^2 - 2*d*tan(
d*x)*tan(c) + d)

Mupad [B] (verification not implemented)

Time = 2.80 (sec) , antiderivative size = 30, normalized size of antiderivative = 1.11 \[ \int \tan ^3(c+d x) \, dx=\frac {{\mathrm {tan}\left (c+d\,x\right )}^2}{2\,d}-\frac {\ln \left ({\mathrm {tan}\left (c+d\,x\right )}^2+1\right )}{2\,d} \]

[In]

int(tan(c + d*x)^3,x)

[Out]

tan(c + d*x)^2/(2*d) - log(tan(c + d*x)^2 + 1)/(2*d)